import logging
import unittest

from common.logging_use import init_log_config
from config import BASE_DIR
from scripts.test_ihrm_emp import TestIhrmEmp
from scripts.test_ihrm_login import TestIhrmLogin
from htmltestreport import HTMLTestReport

# 初始化日志
init_log_config(BASE_DIR + "/log/ihrm_log.log")

logging.info("组装测试套件")
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestIhrmLogin))
suite.addTest(unittest.makeSuite(TestIhrmEmp))

logging.info("生成测试报告")
report = HTMLTestReport("./report/ihrm_report.html", "ihrm测试报告", "测试描述")
report.run(suite)
logging.info("测试报告生成完成！")
